package com.dingding.order.core.pay.dao.impl;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import com.dingding.common.core.base.dao.impl.BaseDaoImpl;
import com.dingding.common.core.beans.UserTaxiOrdert;
import com.dingding.order.core.pay.dao.ITaxiOrderPayDao;

/**
 * 
 * @ClassName: TaxiOrderPayDaoIml 
 * @Description: 出租车订单操作DAO实现
 * @author CHEHAUNBO 
 * @date 2016年7月4日 下午5:16:11
 * @since V2.3.0
 * 
 */
@Component("taxiOrderPayDao")
public class TaxiOrderPayDaoImpl extends BaseDaoImpl<UserTaxiOrdert> implements ITaxiOrderPayDao {

	private Logger log = Logger.getLogger(TaxiOrderPayDaoImpl.class);

	/**
	 * 
	 * 根据出租车订单获取订单信息
	 * 
	 * @Title: getUserTaxiOrder
	 * @param  taxiOrderId 出租车订单ID
	 * @author CHEHAUNBO
	 * @since V2.3.0
	 * 
	 */
	@Override
	public UserTaxiOrdert getUserTaxiOrder(String taxiOrderId) {

		UserTaxiOrdert userTaxiOrdert = null;
		try {
			userTaxiOrdert = super.getById(taxiOrderId);
		} catch (Exception e) {
			log.error("根据出租车订单ID获取订单信息出现异常！", e);
		}

		return userTaxiOrdert;
	}

	/**
	 * 
	 * 订单支付成功后，将临时表中的出租车订单删除
	 * 
	 * @Title: deleteUserTaxiOrder 
	 * @param userTaxiOrdert 出租车临时订单
	 * @author CHEHAUNBO
	 * @since V2.3.0
	 * 
	 */
	@Override
	public void deleteUserTaxiOrder(UserTaxiOrdert userTaxiOrdert) {

		try {
			super.delete(userTaxiOrdert);
		} catch (Exception e) {
			log.error("订单支付成功后，将临时表中的出租车订单删除出现异常！", e);
		}

	}

}
